/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function check_notification(notified) {
	if (notified < 0) return;

	//Create request
	var request = new XMLHttpRequest();

	//Add to chat window if done
	request.onreadystatechange = function() {
		if (request.readyState == 4 && request.status == 200) {
			Response = request.responseText;
			if (Response != "") document.getElementById("notification-title").innerHTML = "Notification";
			document.getElementById("notification-list").innerHTML += request.responseText;
		}
	}

	//Send request
	request.open("POST", "/deviantpic/service/notification.php", true);
	request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	request.send("id=" + notified);

	//Set timeout
	setTimeout("check_notification(" + notified + ")", 5000);
}

